import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class DTDD {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		System.out.print("SDT: ");
		String sdt = scanner.nextLine();
		
		String regex = "09[0-9]{8} | 012[0-9]{8}";
		
		Pattern p = Pattern.compile(regex);
		Matcher m = p.matcher(sdt);
		
		System.out.println(m.matches());

	}

}
